"""mjapp01 URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path
from django.conf.urls import url, include
from django.contrib import admin
from app01 import views


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^login/', views.login),

    # url(r'^test/$', views.test),
    # url(r'^test/[0-9]{4}', views.test),
    url(r'^test/(\d+)/', views.test),    # \d 位置参数
    url(r'^testadd/', views.testadd),
    url(r'^testadd/(?P<year>\d+)/', views.testadd),

    # url(r'home/', views.home),
    # url(r'index/', views.index),
    # url(r'^index_1/', views.index, name='index_view'),
    # url(r'^index_1/(\d+/)', views.index, name='index_view'),
    # url(r'^index_1/(?P<id>\d+)/', views.index, name='index_view'),
    # url(r'^xxx/(\d+)/', views.index, name='index_view'),

    # path('admin/', admin.site.urls),
    # path('login/', views.login)
    url(r'^app01/', include('app01.urls', namespace='app01')),
    url(r'^app02/', include('app02.urls', namespace='app02')),
    url(r'^func1/', views.func1),

    url(r'^get_file/', views.get_file),
    url(r'^get_cbv/', views.MyClass.as_view())
]
